package test;

import sun.swing.BakedArrayList;

import java.beans.BeanInfo;

public class Hierarchy {

    public static void  main(String[] args)
    {
        Ball ball=new Ball();
        ball.setShape("round");
        ball.show();
        Basketball basketball=new Basketball();
        basketball.setShape("round");
        basketball.show();
    }
}
 class Ball
{
    String shape;

    public String getShape() {
        return shape;
    }

    public void setShape(String shape) {
        this.shape = shape;
    }

    public void shape()
    {
        System.out.println(this.getClass().getName());
        System.out.println(shape);
    }
    public void show(){
        shape();
    }
}
class Basketball extends Ball
{
    @Override
    public  void  show(){
        shape();
    }
}

